package org.codehaus.janino.util.resource;

import org.codehaus.janino.Resource;
import java.io.IOException;
import java.io.InputStream;

public class LocalResource implements Resource {

    private final String resource;

    public LocalResource(String resource) {
        this.resource = resource;
    }

    public InputStream open() throws IOException {
        return getClass().getResourceAsStream(resource);
    }

    public String getFileName() {
        throw new UnsupportedOperationException("LocalResource nao tem file name.");
    }

    public long lastModified() {
        throw new UnsupportedOperationException("LocalResource nao tem lastModified.");
    }
}
